package gui;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
import modelo.Motorista;
import modelo.Sgmunicipio;
import modelo.Sguf;
import modelo.dao.MotoristaJpaController;
import modelo.dao.SgmunicipioJpaController;
import modelo.dao.SgufJpaController;
import modelo.dao.exceptions.PreexistingEntityException;
import util.MaiusculaLimitadaAsg;
import util.ManangerEntity;
import util.Mensagem;
import util.NumericPlainDocument;
import util.ValidacaoCPF;

public class GUICadMotorista extends javax.swing.JDialog {

    private boolean guiEncerrado = false;
    boolean incluir = false;
    Motorista motorista;
    SgmunicipioJpaController daoMunicipio = new SgmunicipioJpaController(ManangerEntity.getEntityManagerFactory());
    SgufJpaController daoUf = new SgufJpaController(ManangerEntity.getEntityManagerFactory());
    SimpleDateFormat formatador = new SimpleDateFormat("dd/MM/yyyy");

    
    public GUICadMotorista(boolean incluir, Motorista motorista) {
        this.incluir = incluir;
        this.motorista = motorista;
        initComponents();
        setLocationRelativeTo(null);
        tfNome.grabFocus();
        carregaComboBoxEstados();
        if (!incluir) {
            btSalvar.setText("Alterar");
            carregaMotoristaSelecionado(motorista);
        }

    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnTitulo = new javax.swing.JPanel();
        lbTitulo = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        pnBT = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        btSalvar = new javax.swing.JButton();
        btCancelar = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        pnCadastro = new javax.swing.JPanel();
        pnLabels = new javax.swing.JPanel();
        lbCodigo = new javax.swing.JLabel();
        lbNome = new javax.swing.JLabel();
        lbRg = new javax.swing.JLabel();
        lbCpf = new javax.swing.JLabel();
        lbEndereco = new javax.swing.JLabel();
        lbEstado = new javax.swing.JLabel();
        lbCidade = new javax.swing.JLabel();
        lbBairro = new javax.swing.JLabel();
        lbCep = new javax.swing.JLabel();
        lbTelefone = new javax.swing.JLabel();
        lbFone2 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        lbCelular = new javax.swing.JLabel();
        lbFax = new javax.swing.JLabel();
        pnTF = new javax.swing.JPanel();
        tfId = new javax.swing.JTextField();
        tfNome = new javax.swing.JTextField();
        tfNome.setDocument(new MaiusculaLimitadaAsg(50, true));
        tfRg = new javax.swing.JTextField();
        tfRg.setDocument(new NumericPlainDocument());
        tfCpf = new javax.swing.JTextField();
        try{
            javax.swing.text.MaskFormatter cpf= new javax.swing.text.MaskFormatter("###.###.###-##");
            cpf.setValidCharacters(" 1234567890");
            tfCpf = new javax.swing.JFormattedTextField(cpf);
        }
        catch (Exception e){
        }
        tfEndereco = new javax.swing.JTextField();
        tfEndereco.setDocument(new MaiusculaLimitadaAsg(50, true));
        cbEstado = new javax.swing.JComboBox();
        cbCidade = new javax.swing.JComboBox();
        tfBairro = new javax.swing.JTextField();
        tfBairro.setDocument(new MaiusculaLimitadaAsg(45, true));
        tfCep = new javax.swing.JTextField();
        try{
            javax.swing.text.MaskFormatter cep= new javax.swing.text.MaskFormatter("#####-###");
            cep.setValidCharacters(" 1234567890");
            tfCep = new javax.swing.JFormattedTextField(cep);
        }
        catch (Exception e){
        }
        tfFone1 = new javax.swing.JTextField();
        tfFone1.setDocument(new NumericPlainDocument());
        tfFone2 = new javax.swing.JTextField();
        tfFone2.setDocument(new NumericPlainDocument());
        tfCelular1 = new javax.swing.JTextField();
        tfCelular1.setDocument(new NumericPlainDocument());
        tfCelular2 = new javax.swing.JTextField();
        tfCelular2.setDocument(new NumericPlainDocument());
        tfFax = new javax.swing.JTextField();
        tfFax.setDocument(new NumericPlainDocument());
        pnCNH = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        tfCnhDataEmissao = new javax.swing.JTextField();
        try{
            javax.swing.text.MaskFormatter data= new javax.swing.text.MaskFormatter("##/##/####");
            data.setValidCharacters(" 1234567890");
            tfCnhDataEmissao = new javax.swing.JFormattedTextField(data);
        }
        catch (Exception e){
        }
        tfCnhLocalEmissao = new javax.swing.JTextField();
        tfCnhLocalEmissao.setDocument(new MaiusculaLimitadaAsg(50, true));
        tfCnhOrgaoEmissor = new javax.swing.JTextField();
        tfCnhOrgaoEmissor.setDocument(new MaiusculaLimitadaAsg(10, true));
        tfCnhRegistro = new javax.swing.JTextField();
        tfCnhRegistro.setDocument(new NumericPlainDocument());
        tfCnhPimeiraHab = new javax.swing.JTextField();
        try{
            javax.swing.text.MaskFormatter data= new javax.swing.text.MaskFormatter("##/##/####");
            data.setValidCharacters(" 1234567890");
            tfCnhPimeiraHab = new javax.swing.JFormattedTextField(data);
        }
        catch (Exception e){
        }
        tfCnhDataNasc = new javax.swing.JTextField();
        try{
            javax.swing.text.MaskFormatter data= new javax.swing.text.MaskFormatter("##/##/####");
            data.setValidCharacters(" 1234567890");
            tfCnhDataNasc = new javax.swing.JFormattedTextField(data);
        }
        catch (Exception e){
        }
        tfCnhVencimento = new javax.swing.JTextField();
        try{
            javax.swing.text.MaskFormatter data= new javax.swing.text.MaskFormatter("##/##/####");
            data.setValidCharacters(" 1234567890");
            tfCnhVencimento = new javax.swing.JFormattedTextField(data);
        }
        catch (Exception e){
        }
        tfCnhPai = new javax.swing.JTextField();
        tfCnhPai.setDocument(new MaiusculaLimitadaAsg(50, true));
        tfCnhMae = new javax.swing.JTextField();
        tfCnhMae.setDocument(new MaiusculaLimitadaAsg(50, true));
        tfCnhCategoria = new javax.swing.JTextField();
        tfCnhCategoria.setDocument(new MaiusculaLimitadaAsg(2, true));

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Cadastro de Motoristas");

        pnTitulo.setBackground(new java.awt.Color(255, 255, 255));

        lbTitulo.setFont(new java.awt.Font("Bookman Old Style", 0, 26)); // NOI18N
        lbTitulo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/Male.png"))); // NOI18N
        lbTitulo.setText("CADASTRO DE MOTORISTAS");
        pnTitulo.add(lbTitulo);

        getContentPane().add(pnTitulo, java.awt.BorderLayout.NORTH);

        jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS));
        getContentPane().add(jPanel1, java.awt.BorderLayout.EAST);

        pnBT.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        pnBT.setLayout(new java.awt.BorderLayout());

        jPanel4.setLayout(new java.awt.GridLayout(1, 0));

        btSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/Save.png"))); // NOI18N
        btSalvar.setText("Salvar");
        btSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSalvarActionPerformed(evt);
            }
        });
        jPanel4.add(btSalvar);

        btCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/No-entry.png"))); // NOI18N
        btCancelar.setText("Cancelar");
        btCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCancelarActionPerformed(evt);
            }
        });
        jPanel4.add(btCancelar);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/Exit.png"))); // NOI18N
        jButton1.setText("Sair");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanel4.add(jButton1);

        pnBT.add(jPanel4, java.awt.BorderLayout.CENTER);

        getContentPane().add(pnBT, java.awt.BorderLayout.SOUTH);

        pnCadastro.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        pnCadastro.setLayout(new java.awt.BorderLayout());

        pnLabels.setLayout(new java.awt.GridLayout(14, 1));

        lbCodigo.setText("Código");
        pnLabels.add(lbCodigo);

        lbNome.setText("Nome");
        pnLabels.add(lbNome);

        lbRg.setText("RG");
        pnLabels.add(lbRg);

        lbCpf.setText("CPF");
        pnLabels.add(lbCpf);

        lbEndereco.setText("Endereço");
        pnLabels.add(lbEndereco);

        lbEstado.setText("Estado");
        pnLabels.add(lbEstado);

        lbCidade.setText("Cidade");
        pnLabels.add(lbCidade);

        lbBairro.setText("Bairro");
        pnLabels.add(lbBairro);

        lbCep.setText("Cep");
        pnLabels.add(lbCep);

        lbTelefone.setText("Telefone1");
        pnLabels.add(lbTelefone);

        lbFone2.setText("Telefone2");
        pnLabels.add(lbFone2);

        jLabel10.setText("Celular1");
        pnLabels.add(jLabel10);

        lbCelular.setText("Celular2");
        pnLabels.add(lbCelular);

        lbFax.setText("Fax");
        pnLabels.add(lbFax);

        pnCadastro.add(pnLabels, java.awt.BorderLayout.WEST);

        pnTF.setLayout(new java.awt.GridLayout(14, 1));

        tfId.setEditable(false);
        pnTF.add(tfId);
        pnTF.add(tfNome);
        pnTF.add(tfRg);

        tfCpf.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfCpfActionPerformed(evt);
            }
        });
        pnTF.add(tfCpf);
        pnTF.add(tfEndereco);

        cbEstado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbEstadoActionPerformed(evt);
            }
        });
        pnTF.add(cbEstado);

        cbCidade.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Carregando..." }));
        pnTF.add(cbCidade);
        pnTF.add(tfBairro);
        pnTF.add(tfCep);
        pnTF.add(tfFone1);
        pnTF.add(tfFone2);
        pnTF.add(tfCelular1);
        pnTF.add(tfCelular2);
        pnTF.add(tfFax);

        pnCadastro.add(pnTF, java.awt.BorderLayout.CENTER);

        jTabbedPane1.addTab("Cadastro", pnCadastro);

        pnCNH.setLayout(new java.awt.BorderLayout());

        jPanel2.setLayout(new java.awt.GridLayout(10, 0));

        jLabel1.setText("Data Emissão");
        jPanel2.add(jLabel1);

        jLabel5.setText("Local Emissão");
        jPanel2.add(jLabel5);

        jLabel6.setText("Órgão Emissor");
        jPanel2.add(jLabel6);

        jLabel2.setText("N. Registro");
        jPanel2.add(jLabel2);

        jLabel11.setText("Prim. Habilitação");
        jPanel2.add(jLabel11);

        jLabel3.setText("Data Nascimento");
        jPanel2.add(jLabel3);

        jLabel4.setText("Vencimento");
        jPanel2.add(jLabel4);

        jLabel7.setText("Pai");
        jPanel2.add(jLabel7);

        jLabel8.setText("Mãe");
        jPanel2.add(jLabel8);

        jLabel9.setText("Categoria");
        jPanel2.add(jLabel9);

        pnCNH.add(jPanel2, java.awt.BorderLayout.WEST);

        jPanel3.setLayout(new java.awt.GridLayout(10, 0));
        jPanel3.add(tfCnhDataEmissao);
        jPanel3.add(tfCnhLocalEmissao);
        jPanel3.add(tfCnhOrgaoEmissor);
        jPanel3.add(tfCnhRegistro);
        jPanel3.add(tfCnhPimeiraHab);
        jPanel3.add(tfCnhDataNasc);
        jPanel3.add(tfCnhVencimento);
        jPanel3.add(tfCnhPai);
        jPanel3.add(tfCnhMae);
        jPanel3.add(tfCnhCategoria);

        pnCNH.add(jPanel3, java.awt.BorderLayout.CENTER);

        jTabbedPane1.addTab("CNH", pnCNH);

        getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
        MotoristaJpaController daoMotorista = new MotoristaJpaController(ManangerEntity.getEntityManagerFactory());
        Motorista m = new Motorista();
        m.setNome(tfNome.getText());
        m.setBairro(tfBairro.getText());
        m.setCelular1(tfCelular1.getText());
        m.setCelular2(tfCelular2.getText());
        m.setCep(tfCep.getText());
        m.setEndereco(tfEndereco.getText());
        m.setFax(tfFax.getText());
        m.setFone1(tfFone1.getText());
        m.setFone2(tfFone2.getText());
        m.setCodpais((short) 76);
        m.setPais("Brasil");
        m.setRg(tfRg.getText());
        m.setCpf(tfCpf.getText().replace(".", "").replace("-", ""));
        Sguf u = daoUf.getUfByNomeUfSingle(cbEstado.getSelectedItem().toString());
        m.setCoduf(u.getCoduf());
        m.setNomeuf(cbEstado.getSelectedItem().toString());
        Sgmunicipio mun = daoMunicipio.getMunicipioByNomeMunSingle(cbCidade.getSelectedItem().toString()
                ,u.getSgufPK().getSiglauf());
        m.setCodmunicipio(mun.getSgmunicipioPK().getCodmunic());
        m.setMunicipio(cbCidade.getSelectedItem().toString());
        m.setCnhlocalemissao(tfCnhLocalEmissao.getText());
        m.setCnhcategoria(tfCnhCategoria.getText());
        m.setCnhmae(tfCnhMae.getText());
        m.setCnhpai(tfCnhPai.getText());
        m.setCnhnumeroreg(tfCnhRegistro.getText());
        m.setCnhorgemissor(tfCnhOrgaoEmissor.getText());

        //try para fomatação de datas
        try {
            m.setCnhdataemissao(formatador.parse(tfCnhDataEmissao.getText()));
            m.setCnhdatanascimento(formatador.parse(tfCnhDataNasc.getText()));
            m.setCnhprimhabilitacao(formatador.parse(tfCnhPimeiraHab.getText()));
            m.setCnhvencimento(formatador.parse(tfCnhVencimento.getText()));
        } catch (ParseException ex) {
            Mensagem.exibirMensagem("Erro de data", "Erro", true);
        }

        switch (btSalvar.getText()) {
            case "Salvar":
                try {
                    daoMotorista.create(m);
                    util.Mensagem.exibirMensagem("Cadastro realizado com sucesso!", "Atenção", false);
                    encerrado();
                    this.dispose();
                } catch (PreexistingEntityException ex) {
                    util.Mensagem.exibirMensagem(ex.getMessage(), "Erro daoMotorista", true);
                } catch (Exception ex) {
                    util.Mensagem.exibirMensagem(ex.getMessage(), "Erro daoMotorista", true);
                }
                break;
            case "Alterar":
                m.setId(Integer.parseInt(tfId.getText()));
                try {
                    daoMotorista.edit(m);
                    util.Mensagem.exibirMensagem("Cadastro atualizado com sucesso!", "Atenção", false);
                    encerrado();
                    this.dispose();
                } catch (PreexistingEntityException ex) {
                    util.Mensagem.exibirMensagem(ex.getMessage(), "Erro daoMotorista", true);
                } catch (Exception ex) {
                    util.Mensagem.exibirMensagem(ex.getMessage(), "Erro daoMotorista", true);
                }
                break;
        }
    }//GEN-LAST:event_btSalvarActionPerformed

    private void btCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCancelarActionPerformed
        dispose();
    }//GEN-LAST:event_btCancelarActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void cbEstadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbEstadoActionPerformed
        cbCidade.removeAllItems();

        List<Sguf> SiglaUf = daoUf.getUfByNomeUf(cbEstado.getSelectedItem().toString());

        for (int i = 0; i < SiglaUf.size(); i++) {
            Sguf uf = (Sguf) SiglaUf.get(i);
            List<Sgmunicipio> list = daoMunicipio.getMunicipiosBySiglaUf(uf.getSgufPK().getSiglauf());
            for (int x = 0; x < list.size(); x++) {
                Sgmunicipio mun = (Sgmunicipio) list.get(x);
                cbCidade.addItem(mun.getNomemunic());
            }
        }
    }//GEN-LAST:event_cbEstadoActionPerformed

    private void tfCpfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfCpfActionPerformed
        if (ValidacaoCPF.validaCPF(tfCpf.getText().replace(".", "").replace("-", ""))) {
            System.out.println("true");
        } else {
            System.out.println("false");
        }

    }//GEN-LAST:event_tfCpfActionPerformed

    boolean encerrado() {
        guiEncerrado = true;  //Marcamos que o dados 
        setModal(true);         //A dialog tem que ser modal. Só pode retornar do setVisible após ficar invisível.
        setVisible(true);       //Mostramos a dialog e esperamos o usuário escolher alguma coisa.
        return guiEncerrado;   //Retornamos true, se ele pressionou ok.
    }

    public void carregaComboBoxEstados() {
        List<Sguf> list = daoUf.findSgufEntities();
        for (int i = 0; i < list.size(); i++) {
            Sguf uf = (Sguf) list.get(i);
            //SgufPK sgPk = uf.getSgufPK();
            cbEstado.addItem(uf.getNomeuf());
        }
        cbEstado.setSelectedItem("Rio Grande do Sul");
    }

    public void carregaMotoristaSelecionado(Motorista motorista) {
        tfId.setText(motorista.getId().toString());
        tfNome.setText(motorista.getNome());
        tfEndereco.setText(motorista.getEndereco());
        tfBairro.setText(motorista.getBairro());
        tfCelular1.setText(motorista.getCelular1());
        tfCelular2.setText(motorista.getCelular2());
        tfCep.setText(motorista.getCep());
        tfFax.setText(motorista.getFax());
        tfFone1.setText(motorista.getFone1());
        tfFone2.setText(motorista.getFone2());
        tfCpf.setText(motorista.getCpf());
        tfRg.setText(motorista.getRg());
        tfCnhCategoria.setText(motorista.getCnhcategoria());
        tfCnhDataEmissao.setText(formatador.format(motorista.getCnhdataemissao()).replaceAll("/", ""));
        tfCnhDataNasc.setText(formatador.format(motorista.getCnhdatanascimento()).replaceAll("/", ""));
        tfCnhLocalEmissao.setText(motorista.getCnhlocalemissao());
        tfCnhMae.setText(motorista.getCnhmae());
        tfCnhOrgaoEmissor.setText(motorista.getCnhorgemissor());
        tfCnhPai.setText(motorista.getCnhpai());
        tfCnhPimeiraHab.setText(formatador.format(motorista.getCnhprimhabilitacao()).replaceAll("/", ""));
        tfCnhRegistro.setText(motorista.getCnhnumeroreg());
        tfCnhVencimento.setText(formatador.format(motorista.getCnhvencimento()).replaceAll("/", ""));
        cbEstado.setSelectedItem(motorista.getNomeuf());
        cbCidade.setSelectedItem(motorista.getMunicipio());
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btCancelar;
    private javax.swing.JButton btSalvar;
    private javax.swing.JComboBox cbCidade;
    private javax.swing.JComboBox cbEstado;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel lbBairro;
    private javax.swing.JLabel lbCelular;
    private javax.swing.JLabel lbCep;
    private javax.swing.JLabel lbCidade;
    private javax.swing.JLabel lbCodigo;
    private javax.swing.JLabel lbCpf;
    private javax.swing.JLabel lbEndereco;
    private javax.swing.JLabel lbEstado;
    private javax.swing.JLabel lbFax;
    private javax.swing.JLabel lbFone2;
    private javax.swing.JLabel lbNome;
    private javax.swing.JLabel lbRg;
    private javax.swing.JLabel lbTelefone;
    private javax.swing.JLabel lbTitulo;
    private javax.swing.JPanel pnBT;
    private javax.swing.JPanel pnCNH;
    private javax.swing.JPanel pnCadastro;
    private javax.swing.JPanel pnLabels;
    private javax.swing.JPanel pnTF;
    private javax.swing.JPanel pnTitulo;
    private javax.swing.JTextField tfBairro;
    private javax.swing.JTextField tfCelular1;
    private javax.swing.JTextField tfCelular2;
    private javax.swing.JTextField tfCep;
    private javax.swing.JTextField tfCnhCategoria;
    private javax.swing.JTextField tfCnhDataEmissao;
    private javax.swing.JTextField tfCnhDataNasc;
    private javax.swing.JTextField tfCnhLocalEmissao;
    private javax.swing.JTextField tfCnhMae;
    private javax.swing.JTextField tfCnhOrgaoEmissor;
    private javax.swing.JTextField tfCnhPai;
    private javax.swing.JTextField tfCnhPimeiraHab;
    private javax.swing.JTextField tfCnhRegistro;
    private javax.swing.JTextField tfCnhVencimento;
    private javax.swing.JTextField tfCpf;
    private javax.swing.JTextField tfEndereco;
    private javax.swing.JTextField tfFax;
    private javax.swing.JTextField tfFone1;
    private javax.swing.JTextField tfFone2;
    private javax.swing.JTextField tfId;
    private javax.swing.JTextField tfNome;
    private javax.swing.JTextField tfRg;
    // End of variables declaration//GEN-END:variables
}
